const path = require('path')

module.exports = {
  lintOnSave: false,
  devServer: {
    port: 3000,
    open: true,
    // 反向代理
    proxy: {
      '/hala': {
        target: 'https://mock.mengxuegu.com/mock/6183bc0d397f204c757a3bc7',
        changeOrigin: true,
        pathRewrite: {
          '^/hala': '/hala'
        }
      }
    }
  },
  chainWebpack: config => {
    config.resolve.alias
      .set('@', path.join(__dirname, 'src'))
      .set('_components', path.join(__dirname, 'src/components'))
      .set('_views', path.join(__dirname, 'src/views'))
      .set('_utils', path.join(__dirname, 'src/utils'))
      .set('_api', path.join(__dirname, 'src/api'))
      .set('_assets', path.join(__dirname, 'src/assets'))
  }
}
